<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_quiz_info".
 *
 * @property string $id 主键
 * @property string $item_id 章节id
 * @property string $item_top_id 单元id
 * @property string $b_course_id 组课ID
 * @property string $t_course_id 课程id
 * @property int $empirical_num 经验值
 * @property string $quiz_name 测试名称
 * @property int $timekeeping 测试时间
 * @property double $total_score 总分
 * @property int $renewal_num 重做次数
 * @property string $begin_time 开始时间
 * @property string $end_time 结束时间
 * @property string $quiz_type 类型(测试/作业/考试)
 * @property string $quiz_note 详情
 * @property string $submit_way 开启方式：0手动，1自动
 * @property string $quiz_status 状态
 * @property string $create_by
 * @property string $create_time
 * @property string $update_by
 * @property string $update_time
 * @property string $publish_by 发布老师ID
 * @property string $publish_time 老师发布时间
 * @property string $result_end_time 学生最晚答卷时间
 * @property int $del_flag
 * @property double $pass_line 及格线
 * @property string $score_setting 成绩设置
 * @property string $result_setting 查看结果设置
 * @property string $old_id 对应3.0的测验ID
 */
class TQuizInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_quiz_info';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['empirical_num', 'timekeeping', 'renewal_num', 'del_flag'], 'integer'],
            [['total_score', 'pass_line'], 'number'],
            [['begin_time', 'end_time', 'create_time', 'update_time','publish_by', 'publish_time', 'result_end_time','quiz_name'], 'safe'],
            [['id', 'item_id', 'item_top_id', 'b_course_id', 't_course_id', 'create_by', 'update_by', 'publish_by', 'old_id'], 'string', 'max' => 36],
//            [['quiz_name'], 'string', 'max' => 100],
            [['quiz_type', 'submit_way', 'quiz_status', 'score_setting', 'result_setting'], 'string', 'max' => 64],
            [['quiz_note'], 'string', 'max' => 4000],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'item_id' => 'Item ID',
            'item_top_id' => 'Item Top ID',
            'b_course_id' => 'B Course ID',
            't_course_id' => 'T Course ID',
            'empirical_num' => 'Empirical Num',
            'quiz_name' => 'Quiz Name',
            'timekeeping' => 'Timekeeping',
            'total_score' => 'Total Score',
            'renewal_num' => 'Renewal Num',
            'begin_time' => 'Begin Time',
            'end_time' => 'End Time',
            'quiz_type' => 'Quiz Type',
            'quiz_note' => 'Quiz Note',
            'submit_way' => 'Submit Way',
            'quiz_status' => 'Quiz Status',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'publish_by' => 'Publish By',
            'publish_time' => 'Publish Time',
            'result_end_time' => 'Result End Time',
            'del_flag' => 'Del Flag',
            'pass_line' => 'Pass Line',
            'score_setting' => 'Score Setting',
            'result_setting' => 'Result Setting',
            'old_id' => 'Old ID',
        ];
    }
}
